package wyp.library.ui.listview.drag;

import wyp.library.R;
import wyp.library.ui.listview.drag.DrapFootDelegate;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.LinearLayout;
import android.widget.RelativeLayout;
import android.widget.TextView;

public class FootView_Example extends RelativeLayout implements DrapFootDelegate {

	public View loadMoreView;// mFootView 的view(mFootView)
	public TextView loadMoreTextView;// 加载更多.(mFootView)
	public View loadingView;// 加载中...View(mFootView)

	public FootView_Example(Context context) {
		super(context);
		LayoutInflater.from(context).inflate(R.layout.example_foot, this, true);
		this.loadMoreView = findViewById(R.id.load_more_view);
		this.loadMoreTextView = (TextView) findViewById(R.id.load_more_tv);
		this.loadingView = (LinearLayout) findViewById(R.id.loading_layout);
	}

	@Override
	public View getView() {
		return this;
	}

	@Override
	public void setNormalState() {
		loadingView.setVisibility(View.GONE);
		loadMoreTextView.setVisibility(View.VISIBLE);
		loadMoreTextView.setText("查看更多");
	}

	@Override
	public void setLoadingState() {
		loadingView.setVisibility(View.VISIBLE);
		loadMoreTextView.setVisibility(View.GONE);
	}

	@Override
	public void setLoadedState() {
		loadingView.setVisibility(View.GONE);
		loadMoreTextView.setVisibility(View.VISIBLE);
		loadMoreTextView.setText("加载完毕");
	}

}
